﻿namespace _3_FactoryMethod;

public class Circle:Shape
{
    private double radius;

    private Circle(double radius)
    {
        this.radius = radius;
    }

    internal static Circle CreateInstance(double radius)
    {
        return new Circle(radius);
    }

    public override double Area()
    {
       return Math.PI * radius * radius;
    }

    public override bool IsValid()
    {
        return radius > 0;
    }

    public override string ToString()
    {
        return "Circle"+"\nradius "+radius+"\nArea "+Area();
    }
}